<?php

/**
 * 定义 CliGenApp 类
 *
 * @link http://qeephp.com/
 * @copyright Copyright (c) 2006-2009 Qeeyuan Inc. {@link http://www.qeeyuan.com}
 * @license New BSD License {@link http://qeephp.com/license/}
 * @version $Id: cligen_app.php 2391 2009-04-04 17:56:25Z dualface $
 * @package core
 */
// {{{ includes
require dirname(__FILE__) . '/../clicommand_bootstrap.php';
// }}}

/**
 * CliGenApp 是基于命令行的应用程序生成器
 *
 * @link http://qeephp.com/
 * @copyright Copyright (c) 2006-2009 Qeeyuan Inc. {@link http://www.qeeyuan.com}
 * @license New BSD License {@link http://qeephp.com/license/}
 * @version $Id: cligen_app.php 2391 2009-04-04 17:56:25Z dualface $
 * @package core
 */
class Cli_Test extends Clicommand_Abstract {

    protected $_argv_pattern = array(
        'appname',
        '?dest_dir|-d',
        '?tpl_name|-t',
        '*options|-o',
    );

    function execute() {
        print_r($this->_argv);
        echo "done!\n";
    }

    /**
     * 显示帮助信息
     */
    static function help() {
        echo <<<EOT

newapp <appname> [...]

syntax:
    scripts/newapp <appname> [-d dest_dir] [-t tpl_name] [-o option ...]

examples:
    scripts/newapp myapp
    scripts/newapp myapp -d ~/public_html
    scripts/newapp myapp -d d:\\www -o vhost:true



EOT;
    }

}

// 执行命令行脚本
clicommand_bootstrap('Cli_Test');

